package com.neusoft.neuiotms.dcam.workflow.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcam.workflow.dto.JieyongItemSLDTO;
import com.neusoft.neuiotms.dcam.workflow.model.JieyongItemSL;

@Component
public class JieyongItemSLConverter extends AbstractConverter<JieyongItemSL, JieyongItemSLDTO> {

    @Override
    public JieyongItemSL toModel(final JieyongItemSLDTO dto) {

        final JieyongItemSL model = new JieyongItemSL();

        model.setSpecifications(dto.getSpecifications());
        model.setBigTypeName(dto.getBigTypeName());
        model.setBigTypeCode(dto.getBigTypeCode());
        model.setMiddleTypeName(dto.getMiddleTypeName());
        model.setMiddleTypeCode(dto.getMiddleTypeCode());
        model.setSmallTypeName(dto.getSmallTypeName());
        model.setSmallTypeCode(dto.getSmallTypeCode());
        model.setDetail(dto.getDetail());
        model.setQuantity(dto.getQuantity());
        return model;
    }

    @Override
    public JieyongItemSLDTO toDTO(final JieyongItemSL model, final boolean forListView) {
        final JieyongItemSLDTO dto = new JieyongItemSLDTO();
        dto.setId(model.getId());
        dto.setSpecifications(model.getSpecifications());
        dto.setBigTypeName(model.getBigTypeName());
        dto.setBigTypeCode(model.getBigTypeCode());
        dto.setMiddleTypeName(model.getMiddleTypeName());
        dto.setMiddleTypeCode(model.getMiddleTypeCode());
        dto.setSmallTypeName(model.getSmallTypeName());
        dto.setSmallTypeCode(model.getSmallTypeCode());
        dto.setDetail(model.getDetail());
        dto.setQuantity(model.getQuantity());
        return dto;
    }

}
